//
//  FixProductDetailController.m
//  Soufu580
//
//  Created by 邓启翔 on 14-4-27.
//  Copyright (c) 2014年 Soufu580. All rights reserved.
//

#import "FixProductDetailController.h"
#import "UIImage+Resize.h"
#import "defines.h"
#import "FixProductDetail.h"

@interface FixProductDetailController ()<UITableViewDataSource,UITableViewDelegate>{
    UITableView * table;
    
    UIButton * fixBtn;
    FixProductDetail * fixPrdDetail;
    NSString * title;
    UIImageView *imgLines;
}

-(void)addContentView;
-(void)clickOnBut:(id)btn;

@end

@implementation FixProductDetailController

- (id)initWithProDetail: (FixProductDetail*) prjDetail{
    self = [super init];
    if (self) {
        fixPrdDetail = [[FixProductDetail alloc]init];
        fixPrdDetail.qixian =@"24个月";
        fixPrdDetail.didian =@"成都";
        fixPrdDetail.touziqidian =@"100万元";
        fixPrdDetail.fuxifangshi =@"半年付";
        fixPrdDetail.fashouriqi =@"2014-4-26";
        fixPrdDetail.zixunrenshu =@"10000";
        fixPrdDetail.zixun =@"中融信托与成都建发、成都市龙泉驿区政府三方签署《债权债务确认协议》，明确成都市龙泉驿区政府作为债务人向受托人履行偿付应收账款的义务；龙泉驿区财政局出具相关文件承诺安排专项资金用于债务偿还。";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self addTopViewWithTitle:@"财产权信托" leftButtonTitle:@"返回" rightButtonTitle:nil];
    [self addContentView];
}

-(void)addContentView{
    UILabel * head1 = [[UILabel alloc] initWithFrame:CGRectMake(5, TITLE_HEIGHT+5, 30, 20)];
    head1.font = [UIFont systemFontOfSize:14.0];
    head1.backgroundColor = [UIColor clearColor];
    head1.textColor = [UIColor blackColor];
    head1.text = @"概况";
    [self.view addSubview:head1];
    
    UILabel * head2 = [[UILabel alloc] initWithFrame:CGRectMake(DEVICE_WIDTH-60, TITLE_HEIGHT+5, 60, 20)];
    head2.font = [UIFont systemFontOfSize:14.0];
    head2.backgroundColor = [UIColor clearColor];
    head2.textColor = [UIColor blackColor];
    head2.text = @"信托产品";
    
    [self.view addSubview:head2];
    
    imgLines =[[UIImageView alloc] initWithFrame:CGRectMake(0,TITLE_HEIGHT+30, DEVICE_WIDTH, 5)];
    [self.view addSubview:imgLines];
    UIGraphicsBeginImageContext(imgLines.frame.size);
    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapSquare); //端点形状
    CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 1); //线条粗细
    CGContextSetAllowsAntialiasing(UIGraphicsGetCurrentContext(), YES);
    CGContextSetShouldAntialias(UIGraphicsGetCurrentContext(), NO);//设置线条平滑，不需要两边像素宽
    CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.0, 0.0, 0.0, 0.4); //颜色
    CGContextMoveToPoint(UIGraphicsGetCurrentContext(), 0, 2.5);
    CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), DEVICE_WIDTH, 2.5);
    CGContextStrokePath(UIGraphicsGetCurrentContext());
    imgLines.image=UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)clickOnBut:(id)btn{
//    UIButton * button = (UIButton*)btn;
}

-(void)clickOnLeftBut{
    [self.navigationController popViewControllerAnimated:TRUE];
}

@end
